home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / ixemul / sdk / man / cat4 / tcp.0 < prev    next >
Encoding:
Text File  |  1998-06-15  |  4.3 KB  |  90 lines

  1.  
  2. TCP(4)                     UNIX Programmer's Manual                     TCP(4)
  3.  
  4. NNAAMMEE
  5.      ttccpp - Internet Transmission Control Protocol
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssyyss//ssoocckkeett..hh>>
  9.      ##iinncclluuddee <<nneettiinneett//iinn..hh>>
  10.  
  11.      _i_n_t
  12.      ssoocckkeett(_A_F___I_N_E_T, _S_O_C_K___S_T_R_E_A_M, _0)
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.      The TCP protocol provides reliable, flow-controlled, two-way transmission
  16.      of data.  It is a byte-stream protocol used to support the SOCK_STREAM
  17.      abstraction.  TCP uses the standard Internet address format and, in addi-
  18.      tion, provides a per-host collection of ``port addresses''. Thus, each
  19.      address is composed of an Internet address specifying the host and net-
  20.      work, with a specific TCP port on the host identifying the peer entity.
  21.  
  22.      Sockets utilizing the tcp protocol are either ``active'' or ``passive''.
  23.      Active sockets initiate connections to passive sockets.  By default TCP
  24.      sockets are created active; to create a passive socket the listen(2) sys-
  25.      tem call must be used after binding the socket with the bind(2) system
  26.      call.  Only passive sockets may use the accept(2) call to accept incoming
  27.      connections.  Only active sockets may use the connect(2) call to initiate
  28.      connections.
  29.  
  30.      Passive sockets may ``underspecify'' their location to match incoming
  31.      connection requests from multiple networks.  This technique, termed
  32.      ``wildcard addressing'', allows a single server to provide service to
  33.      clients on multiple networks.  To create a socket which listens on all
  34.      networks, the Internet address INADDR_ANY must be bound.  The TCP port
  35.      may still be specified at this time; if the port is not specified the
  36.      system will assign one.  Once a connection has been established the sock-
  37.      et's address is fixed by the peer entity's location.   The address as-
  38.      signed the socket is the address associated with the network interface
  39.      through which packets are being transmitted and received.  Normally this
  40.      address corresponds to the peer entity's network.
  41.  
  42.      TCP supports one socket option which is set with setsockopt(2) and tested
  43.      with getsockopt(2).  Under most circumstances, TCP sends data when it is
  44.      presented; when outstanding data has not yet been acknowledged, it gath-
  45.      ers small amounts of output to be sent in a single packet once an ac-
  46.      knowledgement is received.  For a small number of clients, such as window
  47.      systems that send a stream of mouse events which receive no replies, this
  48.      packetization may cause significant delays.  Therefore, TCP provides a
  49.      boolean option, TCP_NODELAY (from <_n_e_t_i_n_e_t_/_t_c_p_._h>, to defeat this algo-
  50.      rithm.  The option level for the setsockopt call is the protocol number
  51.      for TCP, available from getprotobyname(3).
  52.  
  53.      Options at the IP transport level may be used with TCP; see ip(4).  In-
  54.      coming connection requests that are source-routed are noted, and the re-
  55.      verse source route is used in responding.
  56.  
  57. DDIIAAGGNNOOSSTTIICCSS
  58.      A socket operation may fail with one of the following errors returned:
  59.  
  60.      [EISCONN]        when trying to establish a connection on a socket which
  61.                       already has one;
  62.  
  63.      [ENOBUFS]        when the system runs out of memory for an internal data
  64.  
  65.  
  66.                       structure;
  67.  
  68.      [ETIMEDOUT]      when a connection was dropped due to excessive retrans-
  69.                       missions;
  70.  
  71.      [ECONNRESET]     when the remote peer forces the connection to be closed;
  72.  
  73.      [ECONNREFUSED]   when the remote peer actively refuses connection estab-
  74.                       lishment (usually because no process is listening to the
  75.                       port);
  76.  
  77.      [EADDRINUSE]     when an attempt is made to create a socket with a port
  78.                       which has already been allocated;
  79.  
  80.      [EADDRNOTAVAIL]  when an attempt is made to create a socket with a net-
  81.                       work address for which no network interface exists.
  82.  
  83. SSEEEE AALLSSOO
  84.      getsockopt(2),  socket(2),  intro(4),  inet(4),  ip(4)
  85.  
  86. HHIISSTTOORRYY
  87.      The ttccpp protocol stack appeared in 4.2BSD.
  88.  
  89. 4.2 Berkeley Distribution        June 5, 1993                                2
  90.